Transfer Tokens
Transfer Tokens from one wallet to another
Networks Supported:
- solana-mainnet
- solana-devnet
Endpoint
POST
/api/v0/tokens/solana/transfer/<YOUR_API_KEY>
Test API Key
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IkZJMHljR2kwYWhYRFplQmtleEFFZm1jVzZ1NTMiLCJpYXQiOjE2NzM1OTQ1NjF9.CI2QEG7Ek6juzthOuV4NAstYKPHerzRXRUPpA1B9sb4
Request Body
Field | Type | Description |
---|---|---|
from_address | string | PublicKey of the address from which the NFT will transfer |
to_address | string | PublicKey of the address to which the NFT will transfer |
token_mint | string | PublicKey of the NFT mint address |
amount | number | Amount of tokens to transfer |
authority | array | The authority secret key array |
network | string | Solana network (solana-mainnet/solana-devnet) |
NOTE:
- The
amount
parameter takes decimals into account. So setting amount to 1 for USDC will mean 1 USDC will be transferred
Code Sample
index.js
const axios = require("axios");
const apiUrl =
"https://app.conciselabs.io/api/v0/tokens/solana/transfer/<YOUR_API_KEY>";
const requestBody = {
from_address: "6cD2Hr6z1QAvuFrTvz9amBVffTkScx8doCA5ykT6U6a9",
to_address: "4cPuZBv5CB7riVMNW8BqDVfvUcQvqaifKrUnyvypGte2",
token_mint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: 100,
authority: [...],
network: "solana-mainnet"
};
const transfer = async () => {
axios({
method: "POST",
url: apiUrl,
data: requestBody,
headers: {
"content-type": "application/json",
},
})
.then((response) => {
console.log(response.data);
})
.catch((err) => {
console.log(err);
});
};
transfer();
Response
{
transaction: {
context: { apiVersion: '1.13.6', slot: 178264771 },
value: {
confirmationStatus: 'finalized',
confirmations: null,
err: null,
slot: 178264729,
status: [Object]
}
},
signature: "367NgbiHLTgvRB3oqiYWxZUtUKmLRTDBvYBJ7atrHYZeS5PmoiggjNMnMMVKcRSD91uDmHksWFh2J2vxRHnsaxDr"
}